

*** This do file creates Figure Panels A and B for the minimum wage precommitment paper

clear all
capture log close
set more off

* Set path* If needed change global path to point to directory where files are stored on your computer
*global path "I:/DataSets5/Duncan/Dropbox/Recent Minimum Wage Changes/2020.12 NBER Update/JOLE Precommittment Replication"
global dtadir "$path/Data"
global tabdir "$path/Tables"
global figdir "$path/Figures"
global estdir "$path/Estimates"
global logdir "$path/Logfiles"

* Load data on minimum wage changes
use "${path}/Data/min_wage_variables_for_ACS_and_CPS_analysis.dta"

cap drop indexer StatIncreaserLarge StatIncreaserSmall statutoryincreasein2014or2015 statutoryincreasein2014to2017 statutoryincreasein2014to2018

gen indexer = 0 
gen StatIncreaserLarge = 0 
gen StatIncreaserSmall = 0 
gen statutoryincreasein2014or2015 = 0
gen statutoryincreasein2014to2018 = 0

* CEP Categories
replace indexer = 1 if originaltype == "Indexer" 
replace statutoryincreasein2014or2015 = 1 if (jan2016min - jan2013min) > 0 & indexer == 0 
replace StatIncreaserLarge = 1 if indexer == 0 & (jan2015min - jan2013min) >= 1 & (jan2016min - jan2013min) != . 
replace StatIncreaserSmall = 1 if indexer == 0 & statutoryincreasein2014or2015 == 1 & StatIncreaserLarge == 0 

* Generate January minimum wage variable
gen effectiveminwage =.
forvalues i=2011/2019 {
	replace effectiveminwage = jan`i'min if year == `i'
}

* Generate policygroup variable for doing proportional sampling correctly
gen policygroup = 1
replace policygroup = 2 if indexer == 1
replace policygroup = 3 if StatIncreaserSmall == 1
replace policygroup = 4 if StatIncreaserLarge == 1

merge m:1 statefip using "${path}/Data/state_fips_master.dta"
drop _merge
rename state_abbr state

label define policylab 1 "No Change" 2 "Indexer" 3 "Increaser < $1" 4 "Increaser >= $1"
label values policygroup policylab

* Map of Minimum Wage Policy Groups Using Original Policy Categories 
maptile policygroup, geography(state) fcolor(Blues) cutpoints(policygroup) ///
twopt(title("Panel A: Original Policy Categories", size(medsmall)) name(cep_categories) ///
legend(order(2 "No Change" 3 "Indexer" 4 "Increaser < $1" 5 "Increaser >= $1")))
graph export "$figdir/cep-policy-categories.pdf", as(pdf) replace


* Load data
use "${path}/Data/min_wage_variables_for_ACS_and_CPS_analysis.dta", clear

cap drop indexer StatIncreaserLarge StatIncreaserSmall statutoryincreasein2014or2015 statutoryincreasein2014to2017 statutoryincreasein2014to2018


gen indexer = 0
replace indexer = 1 if originaltype == "Indexer"
gen statutoryincreasein2014to2018 = 0
replace statutoryincreasein2014to2018 = 1 if (jan2018min - jan2013min) > 0 & indexer == 0
gen StatIncreaserLarge = 0
replace StatIncreaserLarge = 1 if (jan2018min - jan2013min) >= 2.50 & (jan2018min - jan2013min) != .
gen StatIncreaserSmall = 0
replace StatIncreaserSmall = 1 if indexer == 0 & statutoryincreasein2014to2018 == 1 & StatIncreaserLarge == 0
replace StatIncreaserSmall = 1 if indexer == 1 & (jan2018min - jan2013min) > .75 & (jan2018min - jan2013min) < 2.50
replace indexer = 0 if StatIncreaserSmall == 1 | StatIncreaserLarge == 1

* Generate January minimum wage variable
gen effectiveminwage =.
forvalues i=2011/2019 {
	replace effectiveminwage = jan`i'min if year == `i'
}

* Generate policygroup variable for doing proportional sampling correctly
gen policygroup = 1
replace policygroup = 2 if indexer == 1
replace policygroup = 3 if StatIncreaserSmall == 1
replace policygroup = 4 if StatIncreaserLarge == 1

merge m:1 statefip using "${path}/Data/state_fips_master.dta"
drop _merge
rename state_abbr state

label define policylab 1 "No Change" 2 "Indexer" 3 "Increaser < $2.5" 4 "Increaser >= $2.5"
label values policygroup policylab

* Map of Minimum Wage Policy Groups Using New Policy Categories
maptile policygroup, geography(state) fcolor(Blues) cutpoints(policygroup) ///
twopt(title("Panel B: New Policy Categories", size(medsmall)) name(new_categories) ///
legend(order(2 "No Change" 3 "Indexer" 4 "Increaser < $2.5" 5 "Increaser >= $2.5")))
graph export "$figdir/new-policy-categories.pdf", as(pdf) replace

